﻿using MQ.Core.Common;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace MQ.Core.Db
{
    public interface IBaseRepository
    {
        void Add<T>(T entity) where T : class;
        void Update<T>(T entity) where T : class;
        void Delete<T>(T entity) where T : class;
        void Delete(string ids);
        Task DeleteAsync(string ids);
        T GetEntity<T>(long id) where T : class;
        Task AddAsync<T>(T entity) where T : class;
        Task UpdateAsync<T>(T entity) where T : class;
        Task DeleteAsync<T>(T entity) where T : class;
        Task<T> GetEntityAsync<T>(long id) where T : class;
        IEnumerable<T> GetList<T>(string query) where T : class;
        Task<IEnumerable<T>> GetListAsync<T>(string query) where T : class;
        IEnumerable<T> GetPageList<T>(Pagination pagination, string query) where T : class;
        Task<IEnumerable<T>> GetPageListAsync<T>(Pagination pagination, string query) where T : class;
    }
}
